package com.godofgamblers.hotelmanagementsystem.util;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101400686086";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCPG86HShfyjS/KCYiNrqaEp+AaVnsuWnOuDJpsM+RFAmRpA8i7w6yqGrP8pI5kDrjsO1BUeDHUB1QHQUfp0KqKZzlXLiO6Os8XX8YN5SpBEYs39ippWyheRh9W9uAt++5u6VTdM51VrAFb8nhvrbgP79knUxXflcYqf83SSSAE4bSBKJAb7cSXQanSj7IG7saa3MJ1YgbM8+ojYdD0cgucgyldPE/G48ABIivWA8VyYJozggf85jSLZeHiFR2sF0HumxohR+polHSGyEjTl8Kkhp+50AJhW77wfqgb4hywjej6WJ3rOX/tyZmklLHdOAYZWPWpwe3C7Hs3GCRb/KO1AgMBAAECggEAU+HKpsYpT0SudFAuOE3c0PjNhOKYBU2DbMt6YF3yOPjz/hH3wQcq1/Ia+cVCqSdwARerODfTjSJWgIIlMsnajJGArLcgvfHmnR7IKjDfGZC896pUpbiG6utTR1ghgxKeaWhfE+FDIYpWqZxwN5Wtw7mkoUY0Ff/mTdbnv5CZMgJr80q1Rp4s471tYzbMXSkaAwzAgou4MQof6+hUWauEyORFhx8wTuoCmEog9A6ylN8IrAdm9ZtqmjQBiV+8huozLJ8l74is7LpI3yKSkE45NOdZDhEZQBCF5QweNNIJiXe25rj8v25AtYsUwy4KzZKPzSMlWD7LuQHe63Cr2QFtAQKBgQDv+z0eSeRQjo8hkmkOlvUW7Y58AJCc3d+6ABov8+3gQCEfXuy1PGdByMMpT1Xmzvdqkt5rNWAtvP0w3bKm2/VIPSIZ8lfmB9EEtPgE7lXPVUT4w5g+KXyias+D6YotZqijE/MrN9G1nso56YWtODQkAmeYZng90jYFtIOcmdG+VQKBgQCYqTjyJsh0HVB+aO9QkxYKmlIoIBnIUjNbYArqfscdgoWi9+UqkVktBWlbmVrNaFCjVpXq4KUsgHJX0FQVVmmJDIEFT22l8yDwT1hFXoBiXkYhfo3ELxAbbqA0hI1JRcFj7RaBzJbuoUn4rFay4+qd1iWVAa8k0aj8AyY97yfv4QKBgQCzOa52nXbfVui8iOzfEYyvd/FO2Nkn3miFMCheoc2JCjvyguFDpX30WmyuwGqGOxH6zP9BkBZpclihkyEmjuWL8uQx/pT43eOToVgNzrXVZ3hgVSuxWSiU4DJk8RjaOW4+hNq57zE2dAXR5H6KVIxUTFt0LSsl+IWSEzOr1BEaFQKBgQCEhDiLcwEEUkICSSKcBeHXOFhivmLDEh/EjN1M6tn7EsbgTWGfjuYi/5SST8+TiJ6e+tVOOs0GkUUwVwX2M7mOns0MiAM9T4xjLe0I4lx9hypHfuyexN+tgF0O2ZUvap7SGAc2ixrlcBqfAzKLPO73LeIXs4uOYXTXtgAnOQeo4QKBgBZnZvdjGF8g4RfnLUcx0PGXVA8Vnel9qfLCCL0J5xvbpsE7iQsAIOt1/geJWrPIz052iXIEyyN06pFdBy9qojyTRPrUF64vzieXs97HddAODSkfq5410o1OmWasQVMq7mWV8cFUscszPP1ft/oT5/RpfWdzelYm7sIJyElEV79+";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlpGkW4DdBjK0vI5TGqrrfe2AftxyITfMwGyChiSrakkFJwv3A+6fRc7sr9q3mIpMPFGHI79FTXEgbpFTQlvxFs4fKF0exVr5/XBekD+afH6n4HNSbXlb+6aP8nAJv096PE/7835SApFC/r6nvvMzOoPf6lEy6iNG+OuJftJYCnHDOZ2V3vnYiMi/KMhkeeKXhcpYQpZHDq4swCV6Nm1xtUDztmB/O3dwiwP+MLiVAm1t0vkhd7eLlGH7O0V0/rw6jQNZZ3HSLMHwRSwhJa4yf2m2j7eNIzGpJWAsLWDP9yzwPprT63Rpzt3R5gl+ZqWwrKktHSuE6QGmmOK+hZ2kPwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://2n7289n752.wicp.vip/pay/return_notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://2n7289n752.wicp.vip/pay/return_url";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

